package com.google.code.easyparking.vue;
import java.awt.HeadlessException;

import javax.swing.GroupLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;





public class PanneauAffichage extends JFrame {
	
	public void setTexteNbPLaces(int _nbPlaces) {
		TexteNbPLaces.setText(String.valueOf(_nbPlaces));
	}


	public void setTexteStatutParking(String _texte) {
		TexteStatutParking.setText(_texte);
	}


	private JLabel LabelNbPlaces;
	private JLabel LabelStatutParking;
	private JTextField TexteNbPLaces;
	private JTextField TexteStatutParking;

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	
	public PanneauAffichage() throws HeadlessException {
		super();
		initGUI();
		this.setTexteStatutParking("Libre");
		this.setTexteNbPLaces(0);
	}


	private void initGUI() {
		try {
			{
				GroupLayout thisLayout = new GroupLayout(getContentPane());
				getContentPane().setLayout(thisLayout);
				this.setBounds(0, 0, 321, 133);
				getContentPane().setForeground(new java.awt.Color(16,16,16));
				this.setTitle("Simu panneau entrée");
				{
					LabelNbPlaces = new JLabel();
					LabelNbPlaces.setText("Nombre de places disponibles");
				}
				{
					LabelStatutParking = new JLabel();
					LabelStatutParking.setText("Statut du parking");
				}
				{
					TexteStatutParking = new JTextField();
					TexteStatutParking.setEditable(false);
				}
				{
					TexteNbPLaces = new JTextField();
					TexteNbPLaces.setEditable(false);
				}
				thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(TexteStatutParking, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(LabelStatutParking, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE))
					.addGap(17)
					.addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(TexteNbPLaces, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(LabelNbPlaces, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					.addContainerGap(24, 24));
				thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(thisLayout.createParallelGroup()
					    .addComponent(LabelNbPlaces, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 214, GroupLayout.PREFERRED_SIZE)
					    .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
					        .addComponent(LabelStatutParking, GroupLayout.PREFERRED_SIZE, 121, GroupLayout.PREFERRED_SIZE)
					        .addGap(93)))
					.addGroup(thisLayout.createParallelGroup()
					    .addGroup(thisLayout.createSequentialGroup()
					        .addComponent(TexteNbPLaces, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE))
					    .addGroup(thisLayout.createSequentialGroup()
					        .addComponent(TexteStatutParking, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE)))
					.addGap(0, 8, Short.MAX_VALUE));
			}
			pack();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

}
